﻿@model IEnumerable<User>
@{ 
    var rankType = (UserTopOrderBy)ViewData["RankType"];
}
    <ul class="list-group">
        @{ 
            var rank = 1;
            foreach (var item in Model)
            {
                var color = "default";
            <li class="list-group-item">
                @switch (rank)
                {
                    case 1: color = "danger";
                        break;
                    case 2:color = "warning";
                        break;
                    case 3:color= "success";
                        break;
                    default: color = "default";
                        break;
                }
                <div class="pull-left">
                    <span class="label label-@color">@rank</span>
                    <user-home user-id="item.Id"><img src="@item.AvatarUrl" class="img-avatar-16" /> @item.UserName</user-home>
                </div>
                <div class="pull-right">
                    @switch (rankType)
    {
        case UserTopOrderBy.LevelDesc:
                <span class="label label-primary">Lv.@item.Level</span>
break;
case UserTopOrderBy.TradingPointsDesc:
                <i class="fa fa-database text-golden"></i> @item.TradingPoints
break;
case UserTopOrderBy.JoinTimeDesc:
break;
default:
break;
}
                </div>
                <div class="clearfix"></div>
            </li>
                rank++;
            }
            }
        </ul>